import 'osc_user_identity.dart';

class OscAuthor {
  OscUserIdentity identity;
  String name;
  int id;
  String portrait;
  int relation;//0:黑名单,1:相互关注, 2:关注, 3:粉丝, 4:无

  OscAuthor({this.identity, this.name, this.id, this.portrait, this.relation});

  OscAuthor.fromJson(Map<String, dynamic> json) {
    identity = json['identity'] != null ? new OscUserIdentity.fromJson(json['identity']) : null;
    name = json['name'];
    id = json['id'];
    portrait = json['portrait'];
    relation = json['relation'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.identity != null) {
      data['identity'] = this.identity.toJson();
    }
    data['name'] = this.name;
    data['id'] = this.id;
    data['portrait'] = this.portrait;
    data['relation'] = this.relation;
    return data;
  }
}